1. Technology Field
The present invention relates to a data access method for a flash memory, and a flash memory storage system and a flash memory controller using the same.
2. Description of Related Art
In recently years, the consumers' demand to storage media for storing digital contents has increased drastically along with the widespread of digital cameras, cell phones, and MP3. Flash memory is one of the most adaptable storage media to be carried around and used for storing digital files due to its characteristics such as data non-volatility, low power consumption, small volume, and non-mechanical structure. A solid state drive (SSD) is a storage device which uses a flash memory as its storage medium, and SSD has been broadly applied into host computer systems as the primary hard disk.
While accessing data in a flash memory storage system which adopts a flash memory as its storage medium, the flash memory storage system executes an error correcting procedure through an error correcting circuit to verify whether the accessed data is correct. To be specific, when a user is about to write data into the flash memory storage system, the flash memory storage system generates an error correction code (ECC) for the data and writes the data and the ECC into the flash memory. Subsequently, when the user is about to read the data, the flash memory storage system reads the data and the ECC thereof from the flash memory and corrects the data according to the ECC, so as to make sure that the data is correct. In particular, the error correcting circuit and the ECC may vary along with different correction capability. Namely, an error correcting circuit and an ECC of a lower level can only check and correct fewer error bits, while an error correcting circuit and an ECC of a higher level checks and corrects more error bits, wherein the higher-level ECC requires a larger storage space than the lower-level ECC.
Generally speaking, a flash memory in a flash memory storage system includes a plurality of physical blocks, each of the physical blocks has a plurality of pages, and data is written into the flash memory in unit of pages. Each page is divided into a data area and a redundant area, wherein the data area stores data to be written, and the redundant area stores control information related to the page and an ECC. For example, if each page contains one sector (i.e., 512 bytes), 512 bytes are allocated to the data area in this page and 16 bytes are allocated to the redundant area in this page, wherein 6 bytes in the redundant area are used for storing the control information of the page and the other 10 bytes are used for storing the ECC of this page, namely, 10 bytes is enough for storing the ECC corresponding to the data of 512 bytes.
The capacity of each page has been continuously increased along with the advancement of flash memory techniques. For example, presently, there is already such flash memory that has each page thereof containing 4 sectors (i.e., 2048 bytes). Along with the increase in the number of bytes in each page, the error correction capability of the ECC of the page has to be improved accordingly in order to ensure the correction of data stored in the page. Thus, in a page having a data area allocated with 2048 bytes, the redundant area is allocated with 61 bytes, wherein 8 bytes are used for storing the control information while the other 53 bytes are used for storing the ECC corresponding to the data of 2048 bytes.
Generally speaking, a computer system accesses data in unit of sectors. Thus, in a flash memory storage system having each page in its flash memory composed of 4 sectors, because the ECC in each page is generated corresponding to the data of 4 sectors, when the computer system only reads data of one sector from the page, the flash memory storage system still has to read the data in the entire page (i.e., the data of 4 sectors) and executes the error correcting procedure according to the corresponding ECC. Thus, the data access efficiency of the flash memory storage system is seriously reduced when the computer system reads small data.